package com.elong.android.specialhouse.entity;

import com.elong.android.specialhouse.utils.Utils;

import java.io.Serializable;

public class ApartmentKeyword implements Serializable{

	private static final long serialVersionUID = 1L;
	
	//城市
	public final static int TYPE_CITY = 0;

	//行政区
	public final static int TYPE_DISTRICT = 1;
	
	//商圈
	public final static int TYPE_COMMERCIAL = 2;

	//景区
	public final static int TYPE_SCRNICSPOT = 3;

	//个人房源
	public final static int TYPE_APARTMENT = 4;
	
	//智能搜索
	public final static int TYPE_UNKNOWN = -1;
	
	private String id = "";
	private String name = "";
	private String keywordtype = "";// 关键词类型
	private double lng;
	private double lat;
	private boolean accept = false;
	private int type = TYPE_UNKNOWN;

	private int position = -1; // 选中位置
	private int parentPosition = -1; // 上一级目录选中位置
	private String parentName = ""; // 上一级目录名字（仅地铁有效）
	private String parentId = "";
	public int getPosition() {
		return position;
	}

	public void setPosition(int position) {
		this.position = position;
	}

	public int getParentPosition() {
		return parentPosition;
	}

	public void setParentPosition(int parentPosition) {
		this.parentPosition = parentPosition;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKeywordtype() {
		return keywordtype;
	}

	public void setKeywordtype(String keywordtype) {
		this.keywordtype = keywordtype;
	}

	public double getLng() {
		return lng;
	}

	public void setLng(double lng) {
		this.lng = lng;
	}

	public double getLat() {
		return lat;
	}

	public void setLat(double lat) {
		this.lat = lat;
	}

	public boolean isAccept() {
		return accept;
	}

	public void setAccept(boolean accept) {
		this.accept = accept;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void clear() {
		id = "";
		name = "";
		lng = 0;
		lat = 0;
		accept = false;
		type = TYPE_UNKNOWN;
		keywordtype = "";
		position = -1;
		parentPosition = -1;
		parentName = "";
	}

	public String getParentName() {
		return parentName;
	}

	public void setParentName(String parentName) {
		this.parentName = parentName;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}
	/**
	 * ApartmentKeyword是否不包含任何条件
	 * 
	 * @return
	 */
	public boolean isEmptyKeyWord() {
		return Utils.isEmptyString(id) && Utils.isEmptyString(name) && Utils.isEmptyString(keywordtype)
				&& Utils.isEmptyString(parentName) && (!accept) && (lng == 0) && (lat == 0) && (type == TYPE_UNKNOWN)
				&& (position == -1) && (parentPosition == -1);
	}
}
